package com.zzl.bonds.ticket.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zzl.apidoc.annotation.ApidocModel;
import com.zzl.apidoc.annotation.ApidocModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 我的票据
 *
 * @author gull
 * @date 2022-07-06 13:43:52
 */
@Data
@TableName("t_ticket")
@ApidocModel
@SuppressWarnings("javadoc")
public class TicketEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.UUID)
    @ApidocModelProperty(description = "主键")
    private String id;
    @ApidocModelProperty(description = "票据编号")
    private String ticketNo;
    @ApidocModelProperty(description = "所属企业id/接收方id")
    private String enterpriseId;
    @ApidocModelProperty(description = "所属企业名称")
    private String enterpriseName;
    @ApidocModelProperty(description = "票据原始金额")
    private Double ticketAllAmount;
    @ApidocModelProperty(description = "票据可用额度")
    private Double ticketAvailableAmount;
    @ApidocModelProperty(description = "票据剩余金额")
    private Double ticketSurplusAmount;
    @ApidocModelProperty(description = "转让中冻结金额")
    private Double transferFrozenAmount;
    @ApidocModelProperty(description = "融资中冻结金额")
    private Double financeFrozenAmount;
    @ApidocModelProperty(description = "已转让金额")
    private Double transferAmount;
    @ApidocModelProperty(description = "融资金额")
    private Double financeAmount;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApidocModelProperty(description = "开单日期", validate = "yyyy-MM-dd HH:mm:ss")
    private Date invoiceTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApidocModelProperty(description = "兑付日期", validate = "yyyy-MM-dd HH:mm:ss")
    private Date cashTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApidocModelProperty(description = "到期日期", validate = "yyyy-MM-dd HH:mm:ss")
    private Date expireTime;
    @ApidocModelProperty(description = "开单方id")
    private String openEnterpriseId;
    @ApidocModelProperty(description = "开单方企业名称 ")
    private String openEnterpriseName;
    @ApidocModelProperty(description = "转让方id")
    private String transferEnterpriseId;
    @ApidocModelProperty(description = "转让方企业名称")
    private String transferEnterpriseName;
    @ApidocModelProperty(description = "票据状态 1、正常持有 2、拆转待复核中 3、已被拆转 4、融资复核中 5融资完成 6、到期未兑付 7、已兑付")
    private Integer ticketStatus;
    @ApidocModelProperty(description = "合同编号")
    private String contractNo;
    @ApidocModelProperty(description = "票据来源,1:自建")
    private Integer ticketSource;
    @ApidocModelProperty(description = "票据数据来源,1:开立签收，2：转让签收，3融单留存4.转单留存，5转单失败，6融单失败")
    private Integer ticketTypeSource;
    @ApidocModelProperty(description = "来源票据 开票申请表id（可关联上传附件等信息）")
    private String ticketOpenId;
    @ApidocModelProperty(description = "来源票据 转让申请表id")
    private String ticketTransferId;
    @ApidocModelProperty(description = "上一级票的id,票的来源 t_ticket 的主键id")
    private String parentId;
    @ApidocModelProperty(description = "上一级票的id,票的来源 t_ticket 的主键票号")
    private String parentTicketNo;
    @ApidocModelProperty(description = "0 未预兑付 1 进入预兑付。描述：当开立申请单进入预兑付时更改状态。")
    private Integer advancePaymentStatus;
    @ApidocModelProperty(description = "部门id")
    private Integer orgId;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApidocModelProperty(description = "创建时间", validate = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApidocModelProperty(description = "修改时间", validate = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    @ApidocModelProperty(description = "创建人")
    private Integer creatorId;
    @ApidocModelProperty(description = "修改人")
    private Integer updaterId;
    @ApidocModelProperty(description = "备注")
    private String remark;
    @ApidocModelProperty(description = "期限")
    private Integer limitDays;
    @ApidocModelProperty(description = "金融机构id")
    private String instinctyId;
    @ApidocModelProperty(description = "金融机构名称")
    private String instinctyName;
    @ApidocModelProperty(description = "上链地址")
    private String chainAddress;
    @ApidocModelProperty(description = "开单或者转让方,id")
    private String parentEnterpriseId;
    @ApidocModelProperty(description = "开单或者转让方名称")
    private String parentEnterpriseName;
    @ApidocModelProperty(description = "1 表示删除，0 表示未删除")
    @TableField(value = "is_deleted")
    @TableLogic(value = "0", delval = "1")
    private Integer deletedStatus;
    @ApidocModelProperty(description = "失效原因,前端展示：1母单被拆分，2 转单失败，3融单失败，4转单留存回滚，5融单留存回滚，" +
            "注：后台按照InvalidReasonEnum来设置值")
    private String invalidReason;
    @ApidocModelProperty(description = "开立申请表 转让申请表 融资申请表的 id 主键")
    private String parentBusinessId;
    @ApidocModelProperty(description = "我的票据表  原始票 票的 主键id")
    private String ticketOriginId;
    @ApidocModelProperty(description = "兑付状态，1：未兑付，2：等待兑付，3：已兑付，4：逾期未兑付，5逾期已兑付")
    private Integer cashStatus;
    @ApidocModelProperty(description = "应收账款金额")
    private Double receivableAmount;
    @ApidocModelProperty(description = "冻结状态 0，未冻结，1已冻结")
    private Integer frozenState;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApidocModelProperty(description = "签收日期", validate = "yyyy-MM-dd HH:mm:ss")
    private Date receiptTime;
    @ApidocModelProperty(description = "是否指定流转企业，0否 1 是")
    private Integer circulationEnterpriseFlag;
    @ApidocModelProperty(description = "付息方式 ：1 融资方付息（默认）2 核心企业付息")
    private Integer paymentMode;
    @ApidocModelProperty(description = "我的票据表  原始票 票据编号")
    private String ticketOriginNo;
    @ApidocModelProperty(description = "企业冻结状态，0未冻结 1 冻结")
    private Integer enterpriseFreezingStatus;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApidocModelProperty(description = "转单日期", validate = "yyyy-MM-dd HH:mm:ss")
    private Date  transferTime;
    @ApidocModelProperty(description = "转让方企业社会统一代码")
    private String transferSocialCreditCode;
    @ApidocModelProperty(description = "开单企业统一社会信用代码")
    private String openSocialCreditCode;

}
